import React, { Component, Fragment } from 'react';
import {Redirect, Route ,Switch} from "react-router-dom"
import Topbar from "../components/topbar";
import Onetalk from "../components/talkabout/onetalk"

import {LeftOutlined} from "@ant-design/icons";
import loadable from '../util/loadable';

import {Nav,Talk}  from "../styled/talkabout"
export default class talkabout extends Component {
    constructor(props){
        super(props)
    }
    router(route){
        return this.props.history.push(route)
    }
    jumpRouter=()=>{
        this.props.history.push("/router")
    }
    render() {
        return (
            <Fragment>
            <Talk>
                <Topbar>
                    <LeftOutlined onClick={this.jumpRouter}/>
                    <p>談論</p>
                </Topbar>
                <Nav>
                    <div>
                        <p onClick={this.router.bind(this,"/talkabout/oneTalk")}>单独问</p>
                        <p onClick={this.router.bind(this,"/talkabout/readerToker")}>读者论</p>
                    </div>
                </Nav>

            </Talk>
                {/* 路由规则 */}
                <Switch>
                    {/* <Route path="/talkabout/oneTalk" component={loadable(()=>import("./talkabout_er/oneTalk"))}/> */}
                    <Route path="/talkabout/oneTalk" component={loadable(()=>import("./talkaboutEr/oneTalk"))}/>
                    <Route path="/talkabout/readerToker" component={loadable(()=>import("./talkaboutEr/readerToker"))}/>
                    <Redirect from="/" to="/talkabout/oneTalk"/>
                </Switch>
            </Fragment>
        )
    }
}
